﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Enferno.Public.Web.ViewModels
{
    public class VariantViewModel :
        VariantBaseViewModel<FileViewModel, ParametricViewModel, ParametricValueViewModel>
    {
        
    }

    public class VariantBaseViewModel<TFileViewModel, TParametricViewModel, TParametricValueViewModel> : BaseViewModel
        where TFileViewModel: FileViewModel
        where TParametricViewModel: ParametricBaseViewModel<TParametricValueViewModel>
        where TParametricValueViewModel: ParametricValueViewModel
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string PartNo { get; set; }
        public string ManufacturePartNo { get; set; }

        public decimal DisplayPrice { get; set; }
        public decimal CatalogPrice { get; set; }
        public decimal VatRate { get; set; }
        public int PriceListId { get; set; }

        public OnHandStatus OnHandStatus { get; set; }
        public string OnHandStatusText1 { get; set; }
        public string OnHandStatusText2 { get; set; }
        public decimal OnHandStatusCount { get; set; }

        public string ImageUrl { get; set; }

        /// <summary>
        /// Flags are variant specific flags. Common flags are kept at Product level. 
        /// </summary>
        public List<int> Flags { get; set; }

        /// <summary>
        /// Files are variant specific files. Common files are kept at Product level. 
        /// </summary>
        public List<TFileViewModel> Files { get; set; }

        /// <summary>
        /// VariantParametrics are the parameters that distingushes variante from each other.
        /// </summary>
        public List<TParametricViewModel> VariantParametrics { get; set; }

        /// <summary>
        /// Parameterics are the parameters that differ amongst variants, but still can be different amongst variants
        /// </summary>
        public List<TParametricViewModel> Parametrics { get; set; }
    }
}
